package com.nondo.rdp.finance.domain.analysis;

import com.nondo.rdp.auth.domain.User;
import com.nondo.rdp.core.domain.base.BaseEntity;
import com.nondo.rdp.finance.config.DbConfig;

import javax.persistence.*;

/**
 * 金融圈-分析-点赞
 */
@Entity
@Table(name = DbConfig.DEFAULT_TABLE_PREFIX + "analysis_up")
public class AnalysisUp extends BaseEntity {
    private Long id;        //自增ID
    private Analysis analysis;  //点赞的圈子
    private User user;      //点赞用户

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "cid")
    public Analysis getAnalysis() {
        return analysis;
    }

    public void setAnalysis(Analysis analysis) {
        this.analysis = analysis;
    }

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "uid")
    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
